<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>基础知识</title>
	<link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css"" rel="stylesheet">
	<link href="https://cdn.bootcdn.net/ajax/libs/animate.css/3.2.3/animate.css" rel="stylesheet">
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="../static/css/public.css" />
	<style type="text/css">
		li{
			text-indent: 2em;
			list-style: none;
		}
	</style>
</head>
<body>
	<!-- 回到顶部 -->
	<div class="topBtn">
		<a href="#top">
			<i class="fa fa-long-arrow-up"></i>
		</a>
	</div>
	<!--右边内容-->
	<div id="app" class="main animated fadeInRight">
		<div class="shadow">
			<div>
				<div>
					<div class="Table" v-cloak>
						<div class="TableRow" v-for="(el,index) in list">
							<a class="RowRight" :href="'#'+el.id">{{el.name}}</a>
						</div>
					</div>	
				</div>
				<div>
					<div>
						<h4  id="form">Blob 二进制</h4>
						<pre>
		var aBlob = new Blob( array, options );
		==>array 是一个由ArrayBuffer, ArrayBufferView, Blob, DOMString 等对象构成的 Array ，
		或者其他类似对象的混合体，它将会被放进 Blob。DOMStrings会被编码为UTF-8	
					
		var aFileParts = ['<a id="a"><b id="b">hey!</b></a>']; // 一个包含DOMString的数组
		var oMyBlob = new Blob(aFileParts, {type : 'text/html'}); // 得到 blob
			
				
		Blob.slice(start, end, contentType)		
		let blob=new Blob(["这是保存到Blob中的文本数据"],{type:"application/text"})
		let newBlob=blob.slice(0,5,"text/html");
			
			
		blob.stream()	
		let blob=new Blob(["这是保存到Blob中的文本数据"],{type:"application/text"})
		var stream = blob.stream();
		let reader=stream.getReader()
		reader.read().then(content=>/*处理读取到的数据*/console.log(content));
		
		
		Blob.text()
		let blob=new Blob(["这是保存到Blob中的文本数据"],{type:"application/text"})
		var textPromise = blob.text();
		
		blob.text().then(text => /* 执行的操作…… */console.log(text));
		
		var text = await blob.text();
		console.log(text)


		Blob.arrayBuffer()
		var bufferPromise = blob.arrayBuffer();
		blob.arrayBuffer().then(buffer => /* 处理 ArrayBuffer 数据的代码……*/);
		
		var buffer = await blob.arrayBuffer();

						</pre>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!--页面加载进度条-->
	<script src="https://cdn.bootcdn.net/ajax/libs/pace/0.5.0/pace.min.js"></script>
	<!-- <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.5.17/vue.js" type="text/javascript" charset="utf-8"></script> -->
	<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.5.17/vue.js"></script>
	<script type="text/javascript">
		var app = new Vue({
			el: "#app",
			data: function () {
				return {
					list:[
						{name:"Blob 二进制",id:"form"},
						// {name:"open或location.href",id:"open"},
						// {name:"a标签的download",id:"download"},
						// {name:"利用Blob对象",id:"Blob"},
						// {name:"利用base64",id:"base64"},
					]
				}
			},
		})
	</script>
</body>

</html>